<template>
	<div class="app-container">
		<div class="container">
			<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
				<el-tab-pane label="报告管理" name="first">
					<p class="dialogTitle">{{ titleName }}</p>
					<div class="header">
						<span class="title">震情趋势：</span>
						<div class="icon">
							<!-- <svg-icon class-name="error-icon" icon-class="error" /> -->
							<span>
								<el-link :underline="false" @click="updateYj" :class="{updateActiveStyles:form.iaActivityStatus=='1'}">{{ textarea2 }}</el-link>
							</span>
						</div>
					</div>
					<el-row :gutter="10" class="mb8">
						<el-col :span="1.5" v-if="form.iaActivityStatus=='0'">
							<el-button type="primary" @click="handleGenerate">
								<svg-icon class-name="assess-icon" icon-class="assess" /><span
									style="margin-left:10px">报告生成</span>
							</el-button>
						</el-col>
						<el-col :span="1.5">
							<el-button type="primary" @click="handleDownloads" :disabled="multiple">
								<svg-icon class-name="download-icon" icon-class="download" /><span
									style="margin-left:10px">批量下载</span>
							</el-button>
						</el-col>
						<el-col :span="1.5"  v-if="form.iaActivityStatus=='0'">
							<el-button type="primary" @click="handleUpload">
								<svg-icon class-name="upload-icon" icon-class="upload" /><span
									style="margin-left:10px">上传</span>
							</el-button>
						</el-col>
						<!-- <el-col :span="1.5">
							<el-button type="primary" @click="handleSubmit">
								<svg-icon class-name="submit-icon" icon-class="submit" /><span
									style="margin-left:10px">提交审核</span>
							</el-button>
						</el-col> -->
						<el-col :span="1.5"  v-if="form.iaActivityStatus=='0'">
							<el-button type="primary" @click="handleEnd">
								<svg-icon class-name="submit-icon" icon-class="submit" /><span
									style="margin-left:10px">结束活动</span>
							</el-button>
						</el-col>
					</el-row>

					<el-table v-loading="loading" :data="dataExportList" stripe
						@selection-change="handleSelectionChange">
						<el-table-column type="selection" width="55" align="center" />
						<el-table-column label="报告ID" align="center" prop="srNumber" width="160" />
						<el-table-column label="报告名称" align="center" prop="srName" width="255" show-overflow-tooltip>
							<template #default="scope">
								<span v-if="scope.row.flag == '0'">[系统生成]</span><span>{{ scope.row.srName }}</span>
							</template>
						</el-table-column>
						<el-table-column label="报告类型" align="center" prop="srType" width="170" />
						<el-table-column label="生成时间" align="center" prop="srCreateTime" width="160" />
						<el-table-column label="审核状态" align="center" prop="srStatus">
							<template #default="scope">
								<span v-if="scope.row.flag == '1' && scope.row.srStatus == '0'">未审核</span>
								<span v-else-if="scope.row.flag == '1' && scope.row.srStatus == '1'">待审核</span>
								<span v-else-if="scope.row.flag == '1' && scope.row.srStatus == '2'">审核通过</span>
								<span v-else-if="scope.row.flag == '1' && scope.row.srStatus == '3'">审核不通过</span>
								<span v-else-if="scope.row.flag == '0'"></span>
							</template>
						</el-table-column>
						<el-table-column label="评审状态" align="center" prop="pingStatus">
							<template #default="scope">
								<span v-if="scope.row.flag == '1' && scope.row.pingStatus == '0'">未评审</span>
								<span v-else-if="scope.row.flag == '1' && scope.row.pingStatus == '1'">待评审</span>
								<span v-else-if="scope.row.flag == '1' && scope.row.pingStatus == '2'">已评审</span>
								<span v-else-if="scope.row.flag == '0'"></span>
							</template>
						</el-table-column>>
						<el-table-column label="评审专家" align="center" prop="pingJia" show-overflow-tooltip />
						<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160">
							<template #default="scope">
								<!--<el-button type="text" @click="handleDetil(scope.row)">查看</el-button>-->
								<template v-if="scope.row.flag == '1'|| form.iaActivityStatus=='1'">
									<el-button type="text" @click="handleNoPass(scope.row)"
										v-if="scope.row.srStatus == '3'">查看理由</el-button>
										<el-button type="text" @click="handleAgineReport(scope.row)"
										v-if="scope.row.srStatus == '3'">重新上传报告</el-button>
									<el-button type="text" @click="handleIdea(scope.row)"
										v-if="scope.row.srStatus == '2' && scope.row.pingStatus == '2'">查看评审意见
									</el-button>
									<el-button type="text" @click="handleEndIdea(scope.row)"
										v-if="scope.row.srStatus == '2' && scope.row.pingStatus == '2' && scope.row.pingYijian ">查看终版评审意见
									</el-button>
									<el-button type="text" @click="handleUploadIdea(scope.row)"
										v-if="scope.row.srStatus == '2' && scope.row.pingStatus == '2' &&  form.iaActivityStatus=='0'">上传评审意见
									</el-button>
									<el-button type="text" @click="handleAudit(scope.row)"
										v-if="(scope.row.srStatus == '0' || scope.row.srStatus == '3') && scope.row.pingStatus == '0' && form.iaActivityStatus=='0'">
										提交审核</el-button>
									<el-button type="text" @click="handleOpenReview(scope.row)"
										v-if="scope.row.srStatus == '2' && scope.row.pingStatus == '0' && form.iaActivityStatus=='0'">提交评审</el-button>
								</template>
								<el-button type="text" @click="handleDown(scope.row)">下载</el-button>
								<el-button type="text" @click="handledel(scope.row)"
									v-if="(scope.row.flag == '0' || scope.row.srStatus == '0') &&  form.iaActivityStatus=='0'">删除
								</el-button>
							</template>
						</el-table-column>
					</el-table>

				</el-tab-pane>
				<el-tab-pane label="地震灾害风险等级量化评估" name="second">
					<p class="dialogTitle">{{ titleName }}</p>
					<div class="header">
						<span class="title">震情趋势：</span>
						<div class="icon">
							<!-- <svg-icon class-name="error-icon" icon-class="error" /> -->
							<span>{{ textarea2 }}</span>
						</div>
					</div>
					<el-table v-loading="loading" :data="dataQuantificationList" stripe
						@selection-change="handleSelectionChange">
						<el-table-column label="评估内容" align="center" prop="content" />
						<!--<el-table-column label="业务人员" align="center" prop="exportName" />-->

						<el-table-column label="最新结果操作时间" align="center" prop="dateTime" />
						<el-table-column label="操作人" align="center" prop="udPeople" />
						<el-table-column label="联系方式" align="center" prop="exportType" />
						<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
							<template #default="scope">
								<el-button type="text" @click="handleDetil(scope.row)">查看</el-button>

							</template>
						</el-table-column>
					</el-table>
				</el-tab-pane>
				<el-tab-pane label="辅助分析对策" name="third">
					<p class="dialogTitle">{{ titleName }}</p>
					<div class="header">
						<span class="title">震情趋势：</span>
						<div class="icon">
							<!-- <svg-icon class-name="error-icon" icon-class="error" /> -->
							<span>{{ textarea2 }}</span>
						</div>
					</div>
					<el-table v-loading="loading" :data="dataFzdcList" stripe @selection-change="handleSelectionChange">
						<el-table-column label="标题" align="center" prop="exportId" />
						<el-table-column label="类型" align="center" prop="exportName" />
						<el-table-column label="重点目标" align="center" prop="exportType" />
						<el-table-column label="业务人员" align="center" prop="exportType" />
						<el-table-column label="联系方式" align="center" prop="exportType" />
						<el-table-column label="最新结果操作时间" align="center" prop="createTime" />
						<el-table-column label="操作人" align="center" prop="status" />
						<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
							<template #default="scope">
								<el-button type="text" @click="handleDetil1(scope.row)">查看</el-button>

							</template>
						</el-table-column>
					</el-table>
				</el-tab-pane>
			</el-tabs>

			<el-dialog title="震情趋势" v-model="open" width="800px" top="200px" append-to-body>
				<el-form ref="singleRef" label-width="120px">

					<el-row style="margin: 20px 0;">
						<el-col :span="24">
							<el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder=""
								v-model="textarea2">
							</el-input>
						</el-col>
					</el-row>

					<el-checkbox v-model="checked" v-if="isShow">今日不再提醒</el-checkbox>


				</el-form>
				<template #footer>
					<div class="dialog-footer">
						<el-button type="primary" @click="submitForm">确 定</el-button>
						<el-button @click="cancel">取 消</el-button>
					</div>
				</template>
			</el-dialog>


			<el-dialog title="请选择报告类型" v-model="openbglx" width="500px" top="200px" append-to-body>
				<el-form ref="bglxRef" label-width="120px">

					<el-row style="margin: 20px 0;">
						<el-col :span="24">
							<el-radio-group v-model="radio" @change="chooseRadio">
								<el-radio label="地震灾害风险评估报告">地震灾害风险评估报告</el-radio>
								<el-radio label="辅助对策报告">辅助对策报告</el-radio>
							</el-radio-group>
						</el-col>
					</el-row>
				</el-form>
				<template #footer>
					<div class="dialog-footer">
						<el-button type="primary" @click="bglxSubmitForm">确 定</el-button>
						<el-button @click="openbglx = false">取 消</el-button>
					</div>
				</template>
			</el-dialog>

			<el-dialog title="报告管理" v-model="openFile" width="500px" top="200px" append-to-body>
				<el-form ref="bgglRef" label-width="120px">
					<p class="dialogTitle">{{ titleName }}</p>

					<el-row>
						<el-col>
							<el-form-item label="报告名称" style="position: relative;">
								<span class="historyVersion" @click="historyVersion">历史版本查看</span>
								<file-upload :action="uploadFileUrl" :limit="1" ref="fileUpload"
									v-model="formFile.fileList" :fileType='["doc", "docx", "ofd", "txt", "pdf"]' />
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col>
							<el-form-item label="报告Id">
								{{ formFile.srNumber }}
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
				<template #footer>
					<div class="dialog-footer">
						<el-button type="primary" @click="fileSubmitForm" v-if="!isAgine">保 存</el-button>
						<el-button type="primary" @click="fileAgineSubmitForm" v-if="isAgine">保 存</el-button>
						<el-button @click="openFile = false">取 消</el-button>
					</div>
				</template>
			</el-dialog>
			<el-dialog title="报告管理" v-model="openCreate" width="900px" top="200px" append-to-body>
				<!-- <p class="dialogTitle">{{ titleName }}</p>
				<h3><span></span> 报告模板</h3>
				<el-select v-model="formData.reportModle" placeholder="请选择报告模板" clearable>
					<el-option v-for="item in optionModle" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>
				<h3><span></span> 系统生成</h3>
				<table class="tableport">
					<tr>
						<td class="reportTitle">报告名称</td>
						<td class="content">
							<template v-if="formData.reportName">
								<el-link @click="handleDownloadPort()" :underline="false">
									{{ formData.reportName }}
								</el-link>
							</template>
							<div class="button">
								<FileUpload ref="fileUpload" :isShowTip="false"
									:isShow="!formData.userUploadSimpleReportName" v-model="form.fileList"
									:uploadFileUrl='formData.reportPath' :taskId="form.taskId" type="1"
									@uploadSuccess='uploadSuccess' />
							</div>
						</td>
					</tr>
					<tr>
						<td class="reportTitle">报告ID</td>
						<td class="content">
							<span>{{formData.srNumber}}</span>
						</td>
					</tr>
				</table> -->
				<el-form ref="bgglRef" label-width="120px">
					<p class="dialogTitle">{{ titleName }}</p>

					<el-row>
						<el-col>
							<el-form-item label="报告名称">
								<file-upload :action="uploadFileUrl" :limit="1" ref="fileUpload"
									v-model="formFile.fileList" :fileType='["doc", "docx", "ofd", "txt", "pdf"]' />
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col>
							<el-form-item label="报告Id">
								{{ formFile.srNumber }}
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
				<template #footer>
					<div class="dialog-footer">
						<!-- <el-button type="primary" @click="createSubmitForm">保 存</el-button> -->
						<el-button type="primary" @click="fileSubmitForm">保 存</el-button>
						<el-button @click="openCreate = false">取 消</el-button>
					</div>
				</template>
			</el-dialog>
			<el-dialog title="查看历史版本" v-model="versionView" width="900px" top="200px" append-to-body>
				<p></p>
				<p></p>
				<el-table :data="versionList" stripe>
					<el-table-column label="序号" align="center" prop="number" width="55" />
					<el-table-column label="报告类型" align="center" prop="type" />
					<el-table-column label="报告名称" align="center" prop="name" width="255" show-overflow-tooltip>
						<template #default="scope">
							<span @click="handleDown(scope.row)" style="color:#107ce5;cursor: pointer;">{{
									scope.row.name
							}}</span>
						</template>
					</el-table-column>
					<el-table-column label="上传人" align="center" prop="user" />
					<el-table-column label="上传日期" align="center" prop="time" width="160" />
				</el-table>
				<template #footer>
					<div class="dialog-footer">
						<el-button @click="versionView = false">关闭</el-button>
					</div>
				</template>
			</el-dialog>
			<el-dialog title="人员选择（多选）" v-model="openSelectUser" width="1200px" top="200px" append-to-body>
				<select-user ref="selectRef" :isshow="moreNumber" @getSelectList="getSelectList" />
				<template #footer>
					<div class="dialog-footer">
						<el-button type="primary" @click="ok">确 定</el-button>
						<el-button @click="cancelP">取 消</el-button>
					</div>
				</template>
			</el-dialog>
			<!-- 查看原因对话框 -->
			<el-dialog v-model="noPassOpen" title="查看理由" width="900px" append-to-body>
				<p></p>
				<el-form :model="formNoPass" label-width="150px">
					<el-form-item label="审核人">
						<span v-if="formNoPass.mark == '0'">{{ formNoPass.user }}(初步审核)</span>
						<span v-if="formNoPass.mark == '1'">{{ formNoPass.user }}(部门审核)</span>
						<span v-if="formNoPass.mark == '2'">{{ formNoPass.user }}(领导审核)</span>
					</el-form-item>
					<el-form-item label="审核结果"><span>不通过</span></el-form-item>
					<el-form-item label="查看理由"><span>{{ formNoPass.reason }}</span></el-form-item>
				</el-form>
				<template #footer>
					<div class="dialog-footer">
						<el-button @click="noPassOpen = false">关 闭</el-button>
					</div>
				</template>
			</el-dialog>
			<!-- 评审意见对话框 -->
			<el-dialog v-model="openIdea" title="评审意见" width="500px" append-to-body>
				<p></p>
				<el-form ref="ideaRef" :model="formUploadIdae" :rules="rules" label-width="150px">
					<el-form-item label="请上传评审意见" prop="uploadIdeaId">
						<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
							@click="importTemplate('评审意见终版模板.doc')">下载模板</el-link>
						<file-upload ref="fileUploadIdea" v-model="form.uploadIdea" :limit="limit"
							:fileType="['doc', 'docx', 'pdf']" />
					</el-form-item>
				</el-form>
				<template #footer>
					<div class="dialog-footer">
						<el-button type="primary" @click="confirmUpload">确 定</el-button>
						<el-button @click="openIdea = false">取 消</el-button>
					</div>
				</template>
			</el-dialog>
			<!-- 结束活动对话框 -->
			<el-dialog v-model="openEndActive" title="报告进度" width="500px" append-to-body>
				<p></p>
				<ul class="reportActive">
					<li>地震灾害风险评估报告</li>
					<template v-if="reportData.assess.length == 0">
						<p>
							<el-icon color="#F56C6C" :size="20">
								<RemoveFilled />
							</el-icon><span class="personnel">未上传报告</span>
						</p>
					</template>
					<template v-else>
						<template v-if="reportData.assess[0].srStatus == '0'">
							<p>
								<el-icon color="#F56C6C" :size="20">
									<RemoveFilled />
								</el-icon><span class="personnel">未提交</span>
							</p>
						</template>
						<template v-if="reportData.assess[0].srStatus != '0'">
							<p>
								<el-icon color="#67C23A" :size="20">
									<SuccessFilled />
								</el-icon><span class="personnel">提交人</span><span class="value">{{
										reportData.assess[0].submiter
								}}</span>
							</p>
							<p><span class="pass">提交审核</span><span>{{ reportData.assess[0].submitTime }}</span></p>
							<!-- 初步审核 -->
							<template v-if="reportData.assess[0].cbStatus == '0'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<RemoveFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaCbsh
									}}</span>(初步审核)
								</p>
								<p><span class="nopass">未审核</span><span>{{ reportData.assess[0].cbDate }}</span></p>
							</template>
							<template v-if="reportData.assess[0].cbStatus == '2'">
								<p>
									<el-icon color="#67C23A" :size="20">
										<SuccessFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaCbsh
									}}</span>(初步审核)
								</p>
								<p><span class="pass">已提交</span><span>{{ reportData.assess[0].cbDate }}</span></p>
							</template>
							<template v-if="reportData.assess[0].cbStatus == '1'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<RemoveFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaCbsh
									}}</span>(初步审核)
								</p>
								<p><span class="nopass">待审核</span></p>
							</template>
							<template v-if="reportData.assess[0].cbStatus == '3'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<CircleCloseFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaCbsh
									}}</span>(初步审核)
								</p>
								<p><span class="nopass">不通过</span></p>
							</template>
							<!-- 部门审核 -->
							<template v-if="reportData.assess[0].bmStatus == '0'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<RemoveFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaBmsh
									}}</span>(部门审核)
								</p>
								<p><span class="nopass">未审核</span><span>{{ reportData.assess[0].bmDate }}</span></p>
							</template>
							<template v-if="reportData.assess[0].bmStatus == '2'">
								<p>
									<el-icon color="#67C23A" :size="20">
										<SuccessFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaBmsh
									}}</span>(部门审核)
								</p>
								<p><span class="pass">已提交</span><span>{{ reportData.assess[0].bmDate }}</span></p>
							</template>
							<template v-if="reportData.assess[0].bmStatus == '1'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<RemoveFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaBmsh
									}}</span>(部门审核)
								</p>
								<p><span class="nopass">待审核</span></p>
							</template>
							<template v-if="reportData.assess[0].bmStatus == '3'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<CircleCloseFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaBmsh
									}}</span>(部门审核)
								</p>
								<p><span class="nopass">不通过</span></p>
							</template>
							<!-- 领导审核 -->
							<template v-if="reportData.assess[0].ldStatus == '0'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<RemoveFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaLdsh
									}}</span>(领导审核)
								</p>
								<p><span class="nopass">未审核</span></p>
							</template>
							<template v-if="reportData.assess[0].ldStatus == '2'">
								<p>
									<el-icon color="#67C23A" :size="20">
										<SuccessFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaLdsh
									}}</span>(领导审核)
								</p>
								<p><span class="pass">已提交</span><span>{{ reportData.assess[0].ldDate }}</span></p>
							</template>
							<template v-if="reportData.assess[0].ldStatus == '1'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<RemoveFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaLdsh
									}}</span>(领导审核)
								</p>
								<p><span class="nopass">待审核</span></p>
							</template>
							<template v-if="reportData.assess[0].ldStatus == '3'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<CircleCloseFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaLdsh
									}}</span>(领导审核)
								</p>
								<p><span class="nopass">不通过</span></p>
							</template>
							<template v-if="reportData.assess[0].pingYijian">
							<p>
								<el-icon color="#67C23A" :size="20">
									<SuccessFilled />
								</el-icon><span class="personnel">评审意见</span>
							</p>
							<p><span class="pass">已提交(终版)</span></p>
						</template>
						<template v-else>
							<p>
								<el-icon color="#F56C6C" :size="20">
									<RemoveFilled />
								</el-icon><span class="personnel">评审意见</span>
							</p>
							<p><span class="nopass">未提交(终版)</span></p>
						</template>
						</template>
					</template>
				</ul>
				<el-divider />
				<ul class="reportActive">
					<li>辅助分析报告</li>
					<template v-if="reportData.analyse.length == 0">
						<p>
							<el-icon color="#F56C6C" :size="20">
								<RemoveFilled />
							</el-icon><span class="personnel">未上传报告</span>
						</p>
					</template>
					<template v-else>
						<template v-if="reportData.analyse[0].srStatus == '0'">
							<p>
								<el-icon color="#F56C6C" :size="20">
									<RemoveFilled />
								</el-icon><span class="personnel">未提交</span>
							</p>
						</template>
						<template v-if="reportData.analyse[0].srStatus != '0'">
							<p>
								<el-icon color="#67C23A" :size="20">
									<SuccessFilled />
								</el-icon><span class="personnel">提交人</span><span class="value">{{
										reportData.analyse[0].submiter
								}}</span>
							</p>
							<p><span class="pass">提交审核</span><span>{{ reportData.analyse[0].submitTime }}</span></p>
							<!-- 初步审核 -->
							<template v-if="reportData.analyse[0].cbStatus == '0'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<RemoveFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaCbsh
									}}</span>(初步审核)
								</p>
								<p><span class="nopass">未审核</span></p>
							</template>
							<template v-if="reportData.analyse[0].cbStatus == '2'">
								<p>
									<el-icon color="#67C23A" :size="20">
										<SuccessFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaCbsh
									}}</span>(初步审核)
								</p>
								<p><span class="pass">已提交</span><span>{{ reportData.analyse[0].cbDate }}</span></p>
							</template>
							<template v-if="reportData.analyse[0].cbStatus == '1'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<RemoveFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaCbsh
									}}</span>(初步审核)
								</p>
								<p><span class="nopass">待审核</span></p>
							</template>
							<template v-if="reportData.analyse[0].cbStatus == '3'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<CircleCloseFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaCbsh
									}}</span>(初步审核)
								</p>
								<p><span class="nopass">不通过</span></p>
							</template>
							<!-- 部门审核 -->
							<template v-if="reportData.analyse[0].bmStatus == '0'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<RemoveFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaBmsh
									}}</span>(部门审核)
								</p>
								<p><span class="nopass">未审核</span></p>
							</template>
							<template v-if="reportData.analyse[0].bmStatus == '2'">
								<p>
									<el-icon color="#67C23A" :size="20">
										<SuccessFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaBmsh
									}}</span>(部门审核)
								</p>
								<p><span class="pass">已提交</span><span>{{ reportData.analyse[0].bmDate }}</span></p>
							</template>
							<template v-if="reportData.analyse[0].bmStatus == '1'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<RemoveFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaBmsh
									}}</span>(部门审核)
								</p>
								<p><span class="nopass">待审核</span></p>
							</template>
							<template v-if="reportData.analyse[0].bmStatus == '3'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<CircleCloseFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaBmsh
									}}</span>(部门审核)
								</p>
								<p><span class="nopass">不通过</span></p>
							</template>
							<!-- 领导审核 -->
							<template v-if="reportData.analyse[0].ldStatus == '0'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<RemoveFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaLdsh
									}}</span>(领导审核)
								</p>
								<p><span class="nopass">未审核</span></p>
							</template>
							<template v-if="reportData.analyse[0].ldStatus == '2'">
								<p>
									<el-icon color="#67C23A" :size="20">
										<SuccessFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaLdsh
									}}</span>(领导审核)
								</p>
								<p><span class="pass">已提交</span><span>{{ reportData.analyse[0].ldDate }}</span></p>
							</template>
							<template v-if="reportData.analyse[0].ldStatus == '1'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<RemoveFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaLdsh
									}}</span>(领导审核)
								</p>
								<p><span class="nopass">待审核</span></p>
							</template>
							<template v-if="reportData.analyse[0].ldStatus == '3'">
								<p>
									<el-icon color="#F56C6C" :size="20">
										<CircleCloseFilled />
									</el-icon><span class="personnel">审批人</span><span class="value">{{ form.iaLdsh
									}}</span>(领导审核)
								</p>
								<p><span class="nopass">不通过</span></p>
							</template>
							<template v-if="reportData.analyse[0].pingYijian">
								<p>
									<el-icon color="#67C23A" :size="20">
										<SuccessFilled />
									</el-icon><span class="personnel">评审意见</span>
								</p>
								<p><span class="pass">已提交(终版)</span></p>
							</template>
							<template v-else>
								<p>
									<el-icon color="#F56C6C" :size="20">
										<RemoveFilled />
									</el-icon><span class="personnel">评审意见</span>
								</p>
								<p><span class="nopass">未提交(终版)</span></p>
							</template>
						</template>
					</template>
				</ul>
				<template #footer>
					<div class="dialog-footer">
						<el-button type="primary" @click="confirmEnd" :disabled="!endFlag">确 定</el-button>
						<el-button @click="openEndActive = false">取 消</el-button>
					</div>
				</template>
			</el-dialog>
			<el-dialog v-model="openPic" width="900px" :title="title">
				<el-form ref="emUploadRef" :model="queryParams" label-width="100px" style="margin-top: 30px;">
					<div v-if="Content == '地震危险性评估'">
						<div v-if="sraAssContent != '地震活动趋势分析'">
							<el-form-item label="图片" prop="sraAssFileId">
								<image-upload ref="imageUpload" :limit="limit" :disabled="true"
									v-model="queryParams.attach" />
							</el-form-item>
							<el-form-item label="标题" prop="sraAssFileTitel">
								<el-input v-model="queryParams.sraAssFileTitel" placeholder="请输入标题" />
							</el-form-item>
							<el-form-item label="描述" prop="sraAssFileDescribe">
								<el-input v-model="queryParams.sraAssFileDescribe" type="textarea" maxlength="300"
									show-word-limit :autosize="{ minRows: 3, maxRows: 5 }" placeholder="请输入描述" />
							</el-form-item>
						</div>
						<div v-else>
							<el-form-item label="图片" prop="sraAssFileIds">
								<image-upload ref="imageUpload" :limit="limit" :disabled="true"
									v-model="queryParams.attach" />
							</el-form-item>
							<el-form-item label="结论" prop="sraConclusion">
								<el-input v-model="queryParams.sraConclusion" type="textarea" maxlength="300"
									show-word-limit :autosize="{ minRows: 3, maxRows: 5 }" placeholder="请输入结论" />
							</el-form-item>
							<el-form-item label="补充描述" prop="sraSupDescription">
								<el-input v-model="queryParams.sraSupDescription" type="textarea" maxlength="300"
									show-word-limit :autosize="{ minRows: 3, maxRows: 5 }" placeholder="请输入补充描述" />
							</el-form-item>
						</div>
					</div>
					<div v-if="Content == '人口伤亡评估'">
						<el-form-item label="图片" prop="scFileId">
							<image-upload ref="imageUpload" :limit="limit" :disabled="true"
								v-model="queryParams.attach" />
						</el-form-item>
						<el-form-item label="标题" prop="scFileTitle">
							<el-input v-model="queryParams.scFileTitle" placeholder="请输入标题" />
						</el-form-item>
						<el-form-item label="描述" prop="scFileDescribe">
							<el-input v-model="queryParams.scFileDescribe" type="textarea" maxlength="300"
								show-word-limit :autosize="{ minRows: 3, maxRows: 5 }" placeholder="请输入描述" />
						</el-form-item>
					</div>
					<div v-if="Content == '重点场所风险评估'">
						<el-form-item label="上传图片" prop="aiPictureId">
							<image-upload ref="imageUpload" v-model="queryParams.attach" :limit="limit"
								:disabled="true" />
						</el-form-item>
						<el-form-item label="标题" prop="aiPictureTitle">
							<el-input v-model="queryParams.aiPictureTitle" placeholder="请输入标题" />
						</el-form-item>
						<el-form-item label="描述" prop="aiPictureDescription">
							<el-input v-model="queryParams.aiPictureDescription" type="textarea" maxlength="300"
								show-word-limit :autosize="{ minRows: 3, maxRows: 5 }" placeholder="请输入描述" />
						</el-form-item>
						<!--<image-uploads ref="imagesUpload" v-model="uploadImg1" />-->
					</div>
					<div v-if="Content == '次生灾害隐患评估'">
						<template v-if="ssdContent != '地质灾害统计'">
							<el-form-item label="图片" prop="ssdImageId">
								<image-upload ref="imageUpload" :limit="limit" v-model="queryParams.attach"
									:disabled="true" />
							</el-form-item>
							<el-form-item label="标题" prop="ssdImageTitle">
								<el-input v-model="queryParams.ssdImageTitle" placeholder="请输入标题" />
							</el-form-item>
							<el-form-item label="描述" prop="ssdDescribe">
								<el-input v-model="queryParams.ssdDescribe" type="textarea" maxlength="300"
									show-word-limit :autosize="{ minRows: 3, maxRows: 5 }" placeholder="请输入描述" />
							</el-form-item>
						</template>
						<template v-else>
							<el-row>
								<el-col :span="24">
									<el-form-item label="按月统计" prop="ssdMouseFileId">
										<file-upload ref="ssdMouseFileRef" :limit="limit" :fileType="['xlsx']"
											:types="type1" :disabled="true" v-model="queryParams.mouseAttachment" />
										<el-link type="primary" :underline="false"
											style="font-size:12px;vertical-align: baseline;"
											@click="importTemplate('地震地质灾害-按月统计模板.xlsx')">下载模板</el-link>
										<div style="width:100%">
											<el-button type="primary" :disabled="disabledMonFile"
												@click="createExcleMon">生成图表</el-button>
										</div>
									</el-form-item>
									<template v-if="showMon">
										<table width="100%" height="100" border="1" cellspacing="0" cellpadding="0">
											<tr>
												<th colspan="2" rowspan="2">数量月份</th>
												<th colspan="2">灾害总数</th>
												<th colspan="2">滑坡灾害</th>
												<th colspan="2">崩塌灾害</th>
												<th colspan="2">泥石流灾害</th>
												<th colspan="2">地面塌陷灾害</th>
												<th colspan="2">地面沉降灾害</th>
												<th colspan="2">地裂缝不稳定斜坡灾害</th>
												<th colspan="2">其他灾害</th>
											</tr>
											<tr>
												<th>数量</th>
												<th>百分比</th>
												<th>数量</th>
												<th>百分比</th>
												<th>数量</th>
												<th>百分比</th>
												<th>数量</th>
												<th>百分比</th>
												<th>数量</th>
												<th>百分比</th>
												<th>数量</th>
												<th>百分比</th>
												<th>数量</th>
												<th>百分比</th>
												<th>数量</th>
												<th>百分比</th>
											</tr>
											<tr v-for="(item, index) in monList" :key="index">
												<template v-for="(val, ind) in item" :key="ind">
													<td v-if="ind == 0" colspan="2"><span>{{ val }}</span></td>
													<td v-if="ind != 0"><span>{{ val }}</span></td>
												</template>
											</tr>
										</table>
										<div id="mainMonPic" style="width: 700px; height: 500px;padding-left: 100px;">
										</div>
										<p style="text-align: center;font-weight: bold;">月份</p>
									</template>
									<el-form-item label="按月统计标题" prop="ssdMonthTitle">
										<el-input v-model="queryParams.ssdMonthTitle" placeholder="请输入标题" />
									</el-form-item>
								</el-col>
								<el-col :span="24">
									<el-form-item label="区域统计" prop="ssdAreaFileId">
										<file-upload ref="ssdAreaFileRef" :limit="limit" :fileType="['xlsx']"
											:types="type2" :disabled="true" v-model="queryParams.areaAttachment" />
										<el-link type="primary" :underline="false"
											style="font-size:12px;vertical-align: baseline;"
											@click="importTemplate('地震地质灾害-区域统计模板.xlsx')">下载模板</el-link>
										<div style="width:100%">
											<el-button type="primary" :disabled="disabledAreaFile"
												@click="createExcleArea">生成图表</el-button>
										</div>
									</el-form-item>
									<template v-if="showArea">
										<table width="98%" height="100" border="1" style="margin-left:2%"
											cellspacing="0" cellpadding="0">
											<tr>
												<th>区县</th>
												<th>灾害总数</th>
												<th>滑坡灾害</th>
												<th>崩塌灾害</th>
												<th>泥石流灾害</th>
												<th>地面塌陷灾害</th>
												<th>地面沉降灾害</th>
												<th>地裂缝不稳定斜坡灾害</th>
												<th>其他灾害</th>
											</tr>
											<tr v-for="(item, index) in areaList" :key="index">
												<td v-for="(val, ind) in item" :key="ind">
													<span>{{ val }}</span>
												</td>
											</tr>
										</table>
										<div id="mainAreaPic" style="width: 700px; height: 500px;padding-left: 100px;">
										</div>
										<p style="text-align: center;font-weight: bold;">分区</p>
									</template>
									<el-form-item label="区域统计标题" prop="ssdAreaTitle">
										<el-input v-model="queryParams.ssdAreaTitle" placeholder="请输入标题" />
									</el-form-item>
								</el-col>
								<el-col :span="24">
									<el-form-item label="描述" prop="ssdDescribe">
										<el-input v-model="queryParams.ssdDescribe" type="textarea" maxlength="300"
											show-word-limit :autosize="{ minRows: 3, maxRows: 5 }"
											placeholder="请输入描述" />
									</el-form-item>
								</el-col>
							</el-row>
						</template>
					</div>
					<div v-if="Content == '需紧急安置人员'">
						<el-form-item label="上传附件" prop="udFileId">
							<file-upload ref="udFileRef" :limit="limit" :fileType="['xlsx']"
								v-model="queryParams.attachment" :disabled="true" />
							<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
								@click="importTemplate('需紧急安置人员模板.xlsx')">下载模板</el-link>
							<!-- <p style="color:#409eff;cursor: pointer;" @click="handleDown('需紧急安置人员模板.xlsx')">模板下载</p> -->
							<div style="width:100%">
								<el-button type="primary" :disabled="disabledUdFile" @click="createExcle">生成表格
								</el-button>
								<el-table v-loading="loading1" :data="tableList" stripe v-if="showExcle"
									style="margin:20px 0">
									<template v-for="(item, index) in tableTitle" :key="index">
										<el-table-column :label="item.label" align="center" :prop="item.prop" />
									</template>
								</el-table>
							</div>
						</el-form-item>
						<el-form-item label="标题" prop="udTitle">
							<el-input v-model="queryParams.udTitle" placeholder="请输入标题" />
						</el-form-item>
						<el-form-item label="描述" prop="udDescription">
							<el-input v-model="queryParams.udDescription" type="textarea" maxlength="300"
								show-word-limit :autosize="{ minRows: 3, maxRows: 5 }" placeholder="请输入描述" />
						</el-form-item>
					</div>
					<div v-if="Content == '房屋地震灾害风险评估'">
						<template v-if="sdaAssSeiIntensity.substring(0, 4) == '房屋破坏'">
							<el-form-item label="地震烈度" prop="intensity">
								<el-radio-group v-model="queryParams.intensity">
									<el-radio label="6度">6度</el-radio>
									<el-radio label="7度">7度</el-radio>
									<el-radio label="8度">8度</el-radio>
									<el-radio label="9度">9度</el-radio>
									<el-radio label="10度">10度</el-radio>
								</el-radio-group>
							</el-form-item>
						</template>
						<el-form-item label="图片" prop="sdaAssFileId">
							<image-upload ref="imageUpload" :limit="limit" v-model="queryParams.attach"
								:disabled="true" />
						</el-form-item>
						<el-form-item label="标题" prop="sdaAssFileTitel">
							<el-input v-model="queryParams.sdaAssFileTitel" placeholder="请输入标题" />
						</el-form-item>
						<el-form-item label="描述" prop="sdaAssFileDescribe">
							<el-input v-model="queryParams.sdaAssFileDescribe" type="textarea" maxlength="300"
								show-word-limit :autosize="{ minRows: 3, maxRows: 5 }" placeholder="请输入描述" />
						</el-form-item>
					</div>
				</el-form>
				<template #footer>
					<div class="dialog-footer">
						<el-button @click="openPic = false">取消</el-button>
					</div>
				</template>
			</el-dialog>
		</div>
	</div>
</template>

<script setup name="incident1">
import { getEarthquake } from "@/api/assess/earthquake";
import { getEmphasis } from "@/api/assess/emphasis";
import { getHouse } from "@/api/assess/house";
import { getPopulation } from "@/api/assess/population";
import { getSecond } from "@/api/assess/secondary";
import { getUrgency } from "@/api/assess/urgency";
import selectUser from "./selectUser2.vue";
import * as echarts from "echarts";
import { getProvince, getChildArea } from "@/api/system/division";
import { getDict } from "@/api/system/dict";
import imageUploads from './ImageUpload/index.vue'
import {
	getList,
	delList,
	saveList,
	updateList,
	serchList,
	getImport,
	getName,
	getDw,
	getActivityIdList,
	getDataQuantification,
	getDataExport,
	saveReport,
	reUpload,
	delReport,
	getIdReport,
	getReportByFC,
	getVersion,
	submitAudit,
	submitSh,
	getAttachIds,
	uploadYiJian,
	endActive,
} from "@/api/business/activities";
const { proxy } = getCurrentInstance();
const route = useRoute();
const activeName = ref("first");
const radio = ref("地震灾害风险评估报告");
const open = ref(false);
const openbglx = ref(false);
const openFile = ref(false);
const openCreate = ref(false);
const openPic = ref(false);
const loading = ref(false);
const checked = ref(false);
const isShow = ref(true);
const textarea2 = ref("");
const titleName = ref("");
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const form = ref({});
const queryParams = ref({});
const formFile = ref({});
const title = ref();
const Content = ref('');
const sraAssContent = ref('');
const ssdContent = ref('');
const sdaAssSeiIntensity = ref('');
const scAssContent = ref('');

const disabledMonFile = ref(true);
const disabledAreaFile = ref(true);
const mainAreaPic = ref();
const showMon = ref(false);
const showArea = ref(false);
const monTitle = ref();
const areaTitle = ref();
const monList = ref([]);
const areaList = ref([]);

const disabledUdFile = ref(true);
const showExcle = ref(false);
const tableList = ref([]);
const tableTitle = ref([]);

const uploadImg1 = ref([]);
const isUpload = ref(false);

const uploadFileUrl = ref(
	import.meta.env.VITE_APP_BASE_API + "/attachment/uploadFile"
); // 上传的图片服务器地址

const LineChartMon = ref();
const LineChartArea = ref();

const dataExportList = ref([
	{
		exportId: "1",
		exportName: "【系统生成】建党100周年庆祝活动期间北京市城市地震灾害风险评估初步结论",
		exportType: "地震灾害风险评估报告",
		createTime: "",
		status: ""
	}, {
		exportId: "2",
		exportName: "建党100周年庆祝活动期间北京市城市地震灾害风险评估初步结论",
		exportType: "地震灾害风险评估报告",
		createTime: "",
		status: "待审核"
	}, {
		exportId: "3",
		exportName: "【系统生成】建党100周年庆祝活动期间北京市城市辅助对策分析初步结论",
		exportType: "辅助对策报告",
		createTime: "",
		status: "审核通过"
	}, {
		exportId: "4",
		exportName: "建党100周年庆祝活动期间北京市城市辅助对策分析初步结论",
		exportType: "辅助对策报告",
		createTime: "",
		status: "审核未通过"
	}
])

const dataQuantificationList = ref([
	{
		exportId: "地震构造图",
		exportName: "",
		exportType: "",
		createTime: "",
		status: ""
	}, {
		exportId: "历史地震分布图",
		exportName: "",
		exportType: "",
		createTime: "",
		status: ""
	}, {
		exportId: "地震活动趋势分析",
		exportName: "",
		exportType: "",
		createTime: "",
		status: ""
	}, {
		exportId: "地震危险性分析",
		exportName: "",
		exportType: "",
		createTime: "",
		status: ""
	}
])


const dataFzdcList = ref([
	{
		exportId: "1",
		exportName: "物资储备点分布图",
		exportType: "故宫",
		createTime: "",
		status: ""
	}, {
		exportId: "2",
		exportName: "避难场所分布图",
		exportType: "故宫",
		createTime: "",
		status: ""
	}, {
		exportId: "3",
		exportName: "学校分布图",
		exportType: "故宫",
		createTime: "",
		status: ""
	}, {
		exportId: "4",
		exportName: "地震应急疏散辅助决策图",
		exportType: "故宫",
		createTime: "",
		status: ""
	}
])
const optionModle = [{ label: '模板一', value: 0, }, { label: '模板二', value: 1, }]
const formData = ref({
	reportName: '',
	reportModle: '',
	srNumber: '',
})

const versionList = ref([]);
const versionView = ref(false);
const openSelectUser = ref(false);
const moreNumber = ref(2)
const selectUserObj = ref([]);
const auditId = ref();

const noPassOpen = ref(false);
const formNoPass = ref({
	mark: undefined,
	reason: undefined,
	user: undefined,
});
const openEndActive = ref(false);
const openIdea = ref(false);  // 上传评审开关
const formUploadIdae = ref({
	uploadIdeaId: undefined,
	uploadIdea: [],
});
const id = ref();
const rules = ref({
	uploadIdeaId: [{ required: true, message: "上传评审意见不能为空", trigger: "blur" }],
});
//报告信息
const reportData = ref({
	assess: undefined,
	analyse: undefined,
});
const endFlag = ref(false);
const isAgine = ref(false);
const agionId =ref();
function getData() {
	open.value = false;
	getImport(route.query.id).then(response => {
		form.value = response.data.importantActivity;
		textarea2.value = response.data.importantActivity.iaOpinion;
		titleName.value = response.data.importantActivity.iaName;
		if (response.data.importantActivity.iaOpinionStatus == "0") {
			checked.value = false;
			open.value = true;
		} else {
			checked.value = true;
			open.value = false;
		}

	});
}
// 获取srNumber
function getsrNumber(flag, srType) {
	const query = {
		iaId: route.query.id,
		flag: flag,
		srType: srType,
	}
	getIdReport(query).then(res => {
		if (isUpload.value == '1') {
			formFile.value.srNumber = res.data;
		} else {
			formFile.value.srNumber = res.data;
		}
	})
}

function createSubmitForm() {
	proxy.$modal.msg("生成报告");
}

// 下载文件
function handleDownloadPort() {
	proxy.download("/report/downloadReport", {
		srNumber: formData.value.id, type: type, def: def
	}, name);
};
// 查看历史版本
function historyVersion() {
	getVersion({ iaId: route.query.id, }).then(res => {
		versionList.value = res.data ? res.data : [];
		if (versionList.value.length > 0) {
			versionList.value.forEach((item, index) => {
				item.number = index + 1
			})
		}
		versionView.value = true;
	})
}
// 是否覆盖
function getReportByFCs() {
	const query = {
		srType: radio.value,
		iaId: route.query.id,
		flag: isUpload.value ? '1' : '0',
	}
	getReportByFC(query).then(res => {
		if (res.data == '0') {
			saveFile()
		} else if(res.data == '1') {
			proxy.$modal.confirm('是否确认覆盖该报告的数据？').then(function () {
				return saveReport({ iaId: route.query.id, attachId: formFile.value.iabgId, srType: radio.value, srNumber: formFile.value.srNumber, flag: isUpload.value ? '1' : '0', });
			}).then(() => {
				proxy.$modal.msgSuccess("保存成功");
				formFile.value.fileList = [];
				openFile.value = false;
				openCreate.value = false;
				getDataExportList();
			}).catch(() => { });
		}else{
			proxy.$modal.msgError("该报告正在进行无法上传");
		}
	})
}

function saveFile() {
	saveReport({
		iaId: route.query.id,
		attachId: formFile.value.iabgId,
		srType: radio.value,
		srNumber: formFile.value.srNumber,
		flag: isUpload.value ? '1' : '0',
	}).then((res) => {
		openFile.value = false;
		openCreate.value = false;
		proxy.$modal.msgSuccess("新增成功");
		formFile.value.fileList = [];
		getDataExportList();
	});
}
function fileSubmitForm() {
	const fileList = JSON.parse(
		JSON.stringify(proxy.$refs["fileUpload"].fileList)
	);
	// console.log(fileList);
	const attachIds = [];
	for (var i = 0; i < fileList.length; i++) {
		attachIds.push(fileList[i].attachId);
	}
	formFile.value.iabgId = attachIds.join(",");
	getReportByFCs();
	// saveReport({
	// 	iaId: route.query.id,
	// 	attachId: formFile.value.iabgId,
	// 	srType: radio.value,
	// 	srNumber: formFile.value.srNumber,
	// 	flag: isUpload.value ? '1' : '0',
	// }).then((res) => {
	// 	openFile.value = false;
	// 	proxy.$modal.msgSuccess("新增成功");
	// 	formFile.value.fileList = undefined;
	// 	getDataExportList();
	// });
}
function fileAgineSubmitForm() {
	const fileList = JSON.parse(
		JSON.stringify(proxy.$refs["fileUpload"].fileList)
	);
	// console.log(fileList);
	const attachIds = [];
	for (var i = 0; i < fileList.length; i++) {
		attachIds.push(fileList[i].attachId);
	}
	formFile.value.iabgId = attachIds.join(",");
	reUpload({
		srId: agionId.value,
		attachId: formFile.value.iabgId,
	}).then((res) => {
		openFile.value = false;
		proxy.$modal.msgSuccess("上传成功");
		formFile.value.fileList = undefined;
		getDataExportList();
	});
}
// 提交审核
function handleAudit(row) {
	submitSh(row.srId).then(res => {
		proxy.$modal.msgSuccess("提交成功");
		getDataExportList();
	})
}
// 打开提交评审
function handleOpenReview(row) {
	auditId.value = row.srId;
	openSelectUser.value = true;
	selectUserObj.value = [];
	nextTick(() => {
		proxy.$refs["selectRef"].reset();
		proxy.$refs["selectRef"].getTreeselect();
	});
}

// 审核 不通过理由
function handleNoPass(row) {
	formNoPass.value.mark = row.mark;
	if (row.mark == '0') {
		formNoPass.value.reason = row.cbReason;
		formNoPass.value.user = form.value.iaCbsh;
	} else if (row.mark == '1') {
		formNoPass.value.reason = row.bmReason;
		formNoPass.value.user = form.value.iaBmsh;
	} else if (row.mark == '2') {
		formNoPass.value.reason = row.ldReason;
		formNoPass.value.user = form.value.iaLdsh;
	}
	noPassOpen.value = true;
}
// 重新上传报告
function handleAgineReport(row){
	isAgine.value = true;
	agionId.value = row.srId;
	getsrNumber('1', row.srType);
	openFile.value = true;
}
// 选择的数据
function getSelectList(val) {
	val.forEach(item => {
		selectUserObj.value.push({ zjName: item.realName, zjId: item.uuid, srId: auditId.value })
	})
}

// 查看意见下载
function handleIdea(row) {
	getAttachIds(row.srId).then(res => {
		console.log(res.data, '=========');
		proxy.download("/attachment/downForZip/" + res.data.join(","), {}, '评审意见.zip');
	})
}

// 查看终版下载
function handleEndIdea(row) {
	var query = {
        attachId: row.pingYijian,
        name: row.pingYijianName,
    }
    location.href = import.meta.env.VITE_APP_BASE_API + "/attachment/downLoadFile?attachId=" + encodeURIComponent(query.attachId);
}

// 上传意见
function confirmUpload() {
	const fileList = proxy.$refs["fileUploadIdea"] ? JSON.parse(
		JSON.stringify(proxy.$refs["fileUploadIdea"].fileList)
	) : [];
	const attachIds = [];
	for (var i = 0; i < fileList.length; i++) {
		attachIds.push(fileList[i].attachId);
	}
	formUploadIdae.value.uploadIdeaId = attachIds.join(",");
	proxy.$refs["ideaRef"].validate(valid => {
		if (valid) {
			uploadYiJian({ pingYijian: formUploadIdae.value.uploadIdeaId, srId: id.value }).then(res => {
				proxy.$modal.msgSuccess("上传终版意见成功");
				getDataExportList();
				openIdea.value = false;
			})
		}
	});
}

// 上传评审意见
function handleUploadIdea(row) {
	if (row.pingYijian) {
		proxy.$modal.confirm('是否重新上传最终评审意见？').then(function () {
			formUploadIdae.value.uploadIdea = [];
			openIdea.value = true;
			proxy.resetForm("ideaRef");
			id.value = row.srId;
		})
	} else {
		formUploadIdae.value.uploadIdea = [];
		openIdea.value = true;
		proxy.resetForm("ideaRef");
		id.value = row.srId;
	}

}


// 提交人员
function ok() {
	nextTick(() => {
		proxy.$refs["selectRef"].submit();
		submitAudit(selectUserObj.value).then(res => {
			getDataExportList();
			openSelectUser.value = false;
			proxy.$modal.msgSuccess("提交成功");
		})
	});
}

/** 关闭人员弹窗 */
function cancelP() {
	openSelectUser.value = false;
	proxy.$refs["selectRef"].reset();
}



function submitForm() {
	//console.log(form.value)
	var iaOpinionStatus;
	if (checked.value) {
		iaOpinionStatus = 1
	} else {
		iaOpinionStatus = 0
	}
	form.value.iaOpinion = textarea2.value;
	form.value.iaOpinionStatus = iaOpinionStatus;
	updateList(form.value).then((res) => {
		open.value = false;
		proxy.$modal.msgSuccess("修改成功");
	});

}

// 取消按钮
function cancel() {
	open.value = false;
}
function handleGenerate() {
	// proxy.$modal.msg("功能暂无");
	isUpload.value = false;
	openbglx.value = true;
}
function handleDownload() {
	proxy.$modal.msg("功能暂无");
}
function handleUpload() {
	//proxy.$modal.msg("功能暂无");
	isUpload.value = true;
	openbglx.value = true;
	formFile.value = {};


}
/** 批量下载操作 */
function handleDownloads() {
    proxy.download("/attachment/downForZip/"+ ids.value.join(","), { }, '报告.zip');
};

function handleSubmit() {
	proxy.$modal.msg("功能暂无");
}
function handleEnd() {
	openEndActive.value = true;
}
// 确认结束
function confirmEnd() {
	proxy.$modal.confirm('是否确认结束该活动？').then(function () {
		endActive(route.query.id).then((res) => {
			proxy.$modal.msgSuccess("活动已成功");
			openEndActive.value = false;
			getDataExportList();
			getData();
		});
	}).then(() => {

	}).catch(() => { });
}
function updateYj() {
	open.value = true;
}

function handleDown(row) {
	location.href = import.meta.env.VITE_APP_BASE_API + "/attachment/downLoadFile?attachId=" + encodeURIComponent(row.attachId);
}
function handledel(row) {
	proxy.$modal.confirm('是否确认删除？').then(function () {
		delReport(row.srId).then((res) => {

			proxy.$modal.msgSuccess("删除成功");
			getDataExportList();
		});
	}).then(() => {

	}).catch(() => { });

}

function bglxSubmitForm() {
	console.log(radio.value)
	formFile.value.fileList = [];
	formFile.value.srNumber = undefined;
	if (isUpload.value) {
		// formFile.value.fileList = undefined;
		// formFile.value.srNumber = undefined;
		isAgine.value = false;
		getsrNumber('1', radio.value);
		openFile.value = true;
		openbglx.value = false;
	} else {
		getsrNumber('0', radio.value);
		openCreate.value = true;
		openbglx.value = false;
	}


}
/*查询报告*/
function getDataExportList() {
	getDataExport(route.query.id).then((res) => {
		dataExportList.value = res.data;
		reportData.value.assess = res.data.filter(item => item.srType == '地震灾害风险评估报告' && item.flag == '1')
		reportData.value.analyse = res.data.filter(item => item.srType == '辅助对策报告' && item.flag == '1')
		if (reportData.value.assess.length > 0 && reportData.value.analyse.length > 0) {
			endFlag.value = !!reportData.value.analyse[0].pingYijian && !!reportData.value.assess[0].pingYijian;
		} else {
			endFlag.value = false;
		}
		//total.value = res.data.total;
	});
}
/*查询评估*/
function getDataQuantificationList() {
	getDataQuantification(route.query.id).then((res) => {
		dataQuantificationList.value = res.data;
		//total.value = res.data.total;

	});
}

// 重置上传
function reset() {
	queryParams.value = {
		aiPictureId: undefined,
		attach: [],
		aiPictureTitle: '',
		aiPictureDescription: '',
	}
	proxy.resetForm("emUploadRef");
	uploadImg1.value = [];
}
/** 查看方法*/
function handleDetil(row) {
	title.value = '查看';
	reset();
	if (row.taskName == "地震危险性评估") {
		Content.value = "地震危险性评估"
		if (row.content == "地震活动趋势分析") {
			sraAssContent.value = "地震活动趋势分析"
		} else {
			sraAssContent.value = ""
		}
		getEarthquake(row.id).then(response => {
			queryParams.value = response.data.riskAssessmentById;
			sraAssContent.value = response.data.riskAssessmentById.sraAssContent;
			queryParams.value.attach = [response.data.attach];
			title.value = "查看"
			openPic.value = true;
		})
	} else if (row.taskName == "人口伤亡评估") {
		Content.value = "人口伤亡评估"
		getPopulation(row.id).then(response => {
			queryParams.value = response.data.casualtiesEntity;
			scAssContent.value = response.data.casualtiesEntity.scAssContent;
			queryParams.value.attach = [response.data.attach];
			title.value = "查看"
			openPic.value = true;
		})
	} else if (row.taskName == "重点场所风险评估") {
		Content.value = "重点场所风险评估"
		getEmphasis(row.id).then(response => {
			if (response.data.assInfos.length > 1) {
				uploadImg1.value = response.data.assInfos.splice('1')
				console.log(uploadImg1.value, 'ashgauygdua');
			}
			queryParams.value = response.data.assInfos[0];
			queryParams.value.attach = [response.data.assInfos[0].attachmentInfoEntity];
			//	    krId.value = response.data.krId;
			title.value = "查看"
			openPic.value = true;
		})
	} else if (row.taskName == "次生灾害隐患评估") {
		Content.value = "次生灾害隐患评估"
		if (row.content == "地质灾害统计") {
			ssdContent.value = "地质灾害统计"
		}
		getSecond(row.id).then(response => {
			if (document.getElementById('mainMonPic')) {
				LineChartMon.value.dispose();
			}
			if (document.getElementById('mainAreaPic')) {
				LineChartArea.value.dispose();
			}
			queryParams.value = response.data.secondDisastersById;
			ssdContent.value = response.data.secondDisastersById.ssdContent;
			queryParams.value.mouseAttachment = [response.data.mouseAttachment];
			queryParams.value.areaAttachment = [response.data.areaAttachment];
			queryParams.value.attach = [response.data.imageAttachment];
			title.value = "查看"
			openPic.value = true;
			nextTick(() => {
				monList.value = response.data.excelByMouth.lists;
				initMon(response.data.excelByMouth);
				areaList.value = response.data.excelByArea.lists;
				initArea(response.data.excelByArea);
			})
			disabledMonFile.value = false;
			disabledAreaFile.value = false;
			showMon.value = true;
			showArea.value = true;
		})
	} else if (row.taskName == "需紧急安置人员") {
		Content.value = "需紧急安置人员"
		getUrgency(row.id).then(response => {
			queryParams.value = response.data.urgencysettleData;
			queryParams.value.attachment = [response.data.attach];
			Object.entries(response.data.forms[0]).forEach(item => {
				tableTitle.value.push({ label: item[1], prop: item[0] })
			})
			tableList.value = response.data.forms.splice('1');
			disabledUdFile.value = false;
			showExcle.value = true;
			title.value = "查看"
			openPic.value = true;
		})
	} else if (row.taskName == "房屋地震灾害风险评估") {
		Content.value = "房屋地震灾害风险评估"
		sdaAssSeiIntensity.value = row.content
		getHouse(row.id).then(response => {
			queryParams.value = response.data.disasterAssEntity;
			sdaAssSeiIntensity.value = response.data.disasterAssEntity.sdaAssSeiIntensity;
			queryParams.value.intensity = sdaAssSeiIntensity.value.split('-')[1];
			queryParams.value.attach = [response.data.attach];
			title.value = "查看"
			openPic.value = true;
		})
	}


}

function initMon(data) {
	// 基于准备好的dom，初始化echarts实例
	console.log(document.getElementById('mainMonPic'), '获取id');
	//   document.getElementById("mainMonPic").removeAttribute('_echarts_instance_');
	LineChartMon.value = echarts.init(document.getElementById('mainMonPic'));
	// 指定图表的配置项和数据
	var option = {
		xAxis: {
			type: 'category',
			data: data.mouth,
			axisLabel: {
				interval: 0, // 调整数值即可调整坐标显示间隔
			}
		},
		yAxis: {
			type: 'value',
			name: '数量'
		},
		series: [
			{
				name: '数量',
				data: data.sum,
				type: 'bar',
			},
		]
	};
	// 使用刚指定的配置项和数据显示图表。 给一个延时
	LineChartMon.value.clear();
	option && LineChartMon.value.setOption(option);
}

function initArea(data) {
	// 基于准备好的dom，初始化echarts实例
	//   document.getElementById("mainAreaPic").removeAttribute('_echarts_instance_');
	LineChartArea.value = echarts.init(document.getElementById('mainAreaPic'));
	// 指定图表的配置项和数据
	var option = {
		xAxis: {
			type: 'category',
			data: data.areaList
		},
		yAxis: {
			type: 'value',
			name: '数量/起'
		},
		series: [
			{
				data: data.countList,
				type: 'bar',
			}
		]
	};
	// 使用刚指定的配置项和数据显示图表。
	LineChartArea.value.clear();
	option && LineChartArea.value.setOption(option);
}
// 生成按月的图表
function createExcleMon() {
	createMonFile(queryParams.value.ssdMouseFileId).then(res => {
		console.log(res.data);
		showMon.value = true;
		nextTick(() => {
			monList.value = res.data.lists;
			initMon(res.data);
		})
	})
}

// 生成区域的图表
function createExcleArea() {
	createAreaFile(queryParams.value.ssdAreaFileId).then(res => {
		console.log(res.data);
		showArea.value = true;
		nextTick(() => {
			areaList.value = res.data.lists;
			initArea(res.data);
		})
	})
}

// 模板下载
function importTemplate(name) {
	proxy.download("/fxfzaqbz/data/downloadExcel", {
		fileName: name
	}, name);
};

function getDetail(id) {
	getEmphasis(id).then(response => {
		if (response.data.assInfos.length > 1) {
			uploadImg1.value = response.data.assInfos.splice('1')
			console.log(uploadImg1.value, 'ashgauygdua');
		}
		queryParams.value = response.data.assInfos[0];
		queryParams.value.attach = [response.data.assInfos[0].attachmentInfoEntity];
		krId.value = response.data.krId;
		title.value = "查看"
		//open.value = true;
	})
}
/*切换标签页*/
function handleClick(tab, event) {
	console.log(tab, event);
	console.log(tab.props.name);
	if (tab.props.name == "first") {
		//getMapList();
	} else if (tab.props.name == "second") {
		getDataQuantificationList();
	}
}
/** 多选框选中数据 */
function handleSelectionChange(selection) {
	ids.value = selection.map((item) => item.attachId);
	single.value = selection.length != 1;
	multiple.value = !selection.length;
}
function chooseRadio(value) {
	console.log(value)

}
getDataExportList()
getData()
</script>

<style lang="scss" scoped>
.container {
	margin: 0px auto;
	height: 100%;
	width: 1300px;
	overflow-y: auto;

	.worrning {
		width: 340px;
		height: 110px;
		color: #3d4a5d;
		font-size: 18px;
		line-height: 26px;
		background: #f5f9fe;
		margin: 30px auto 10px;
		padding: 15px;
	}

	.header {
		padding: 10px 0px;

		.title {
			font-size: 18px;
			font-weight: bold;
		}

		div {
			height: 60px;
			line-height: 60px;
			margin-top: 10px;

			&.icon {
				padding: 0 20px;
				background: #f5f9fe;
			}

			span {
				margin-left: 10px;
			}
		}
	}
}

.tableport {
	border-collapse: collapse;
	width: 100%;

	tr {
		height: 54px;

		td {
			border: 1px solid #000;

			&.reportTitle {
				text-align: center;
				width: 250px;
				font-weight: 700;
				color: 16px;
			}

			&.content {
				padding: 0px 20px;
				line-height: 54px;

				.button {
					float: right;
					height: 54px;
					vertical-align: middle;
				}
			}
		}
	}

}

h3 {
	color: #333;
	height: 21px;
	font-size: 16px;
	line-height: 21px;
	display: flex;
	align-items: center;

	span {
		margin-right: 12px;
		display: inline-block;
		width: 3px;
		height: 16px;
		background: #333;
	}
}

.historyVersion {
	display: flex;
	color: #107ce5;
	font-size: 14px;
	cursor: pointer;
	position: absolute;
	top: 0;
	right: 0;
}

.reportActive {
	list-style-type: circle;

	li {
		font-weight: 700;
	}

	p {
		display: flex;
		align-items: center;

		.personnel {
			padding-left: 8px;
			display: inline-block;
			width: 100px;
		}

		.pass {
			margin-left: 28px;
			color: #67C23A;
			width: 100px;
		}

		.nopass {
			margin-left: 28px;
			color: #F56C6C;
			width: 100px;
		}

		.value {
			color: #000;
			padding-right: 10px;
		}
	}
}

.updateActiveStyles{
	pointer-events:none;
}
</style>